package com.model;

import cn.hutool.core.util.RandomUtil;
import com.baima46.annotion.ExcelHeader;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description
 * @Author yuan cong
 * @Date 2020/12/4 0004
 */
@Data
public class Person {
    @ExcelHeader({"姓名", "姓名"})
    private String name;
    @ExcelHeader(value = {"国籍", "国籍"}, group = "g")
    private String nationality;
    @ExcelHeader(value = {"地区", "地区"}, group = "d")
    private String region;
    @ExcelHeader({"年龄", "年龄"})
    private int age;




    public Person() {
        name = "张三" + RandomUtil.randomInt(10, 99);
        nationality = "国家" + RandomUtil.randomInt(1, 99);
        region = "地区" + RandomUtil.randomInt(1, 99);
        age = RandomUtil.randomInt(20, 50);
    }

    /**
     * 生成导出的数据
     * @param num
     * @return
     */
    public static List<Person> getPerson(int num) {
        List<Person> list = new ArrayList<>(num);
        for (int j = 0; j < num; j++) {
            list.add(new Person());
        }

        return list;
    }
}
